#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;

int main() {
	int arr[] = { 1, 2, 3, 4, 5 };


	typedef int* iterator;
	iterator it = arr;

	*it = 10;//it指向的内容可以更改
	++it;//it本身也可以更改
	std::cout << "val: " << *it << std::endl;


	const iterator cit = arr; // cit 是 int* const
	*cit = 20;  // 合法
	// ++cit;    // 非法
	std::cout << "const iterator: " << *cit << std::endl;


	//typedef const int* const_iterator;
	//const_iterator c_it = arr; // c_it 是 const int*
	////*c_it = 30;  // 非法
	//++c_it;        // 合法
	//std::cout << "const_iterator: " << *c_it << std::endl;

	return 0;
}